<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>电子书网站</title>
    <!-- 引入公用部分 -->
    <script th:replace="common/head::static"></script>
</head>
<body>
<!--表格位置-->
<table class="layui-hide" id="sourceTable" lay-filter="test"></table>

<script type="text/html" id="toolbarSource">
    <div class="layui-inline" style="float:right;height:29px;" title="同步" lay-event="syncData"><i class="layui-icon layui-icon-refresh-3"></i></div>
    <div class="layui-inline" style="float:right;height:29px;" title="新增" lay-event="addData"><i class="layui-icon layui-icon-add-1"></i></div>
    <div class="layui-inline" style="float:right;height:29px;" title="搜索" lay-event="query"><i class="layui-icon layui-icon-search"></i></div>
    <input type="text" id="sourceTxt" style="width:200px;float:right;height:30px;" placeholder="请输入网站名称" autocomplete="off" class="layui-input">
</script>

<script type="text/html" id="barSource">
    <a class="layui-btn layui-btn-xs" lay-event="getBook">获取</a>
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>

<!--编辑弹出框-->
<div class="sourceEditDiv">
    <!-- 操作表单 -->
    <form id="sourceForm" class="layui-form layui-form-pane" lay-filter="sourceFormFilter" >
        <div class="layui-form-item">
            <label class="layui-form-label">网站标题</label>
            <div class="layui-input-block">
                <input type="text" id="sourceTitle" name="sourceTitle" autocomplete="off" placeholder="网站标题"
                       lay-verify="sourceTitle" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">网站地址</label>
            <div class="layui-input-block">
                <input type="text" id="sourceUrl" name="sourceUrl" autocomplete="off" placeholder="网站地址"
                       lay-verify="sourceUrl" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">网站源</label>
            <div class="layui-inline" style="width: 50%;">
                <input id="sourceWeb" placeholder="源" class="layui-input"  />
                <input type="text" id="sourceWebHidden" name="sourceWeb" hidden="hidden" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">网站分类</label>
            <div class="layui-inline" style="width: 50%;">
                <input id="sourceCategory" placeholder="分类" class="layui-input" />
                <input type="text" id="sourceCategoryHidden" name="sourceCategory" hidden="hidden" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">分类地址</label>
            <div class="layui-input-block">
                <input type="text" id="sourceCrawlPath" name="sourceCrawlPath" autocomplete="off" placeholder="网站分类地址"
                       lay-verify="sourceCrawlPath" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">是否可用</label>
            <div class="layui-input-block">
                <input type="checkbox" id="sourceState" name="sourceState" lay-skin="switch" value="true">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">下载方式</label>
            <div id="sourceDownloadType" class="layui-input-block">
                <input type="radio" name="sourceDownloadType" value="1" title="网址下载" th:selected="true">
                <input type="radio" name="sourceDownloadType" value="2" title="章节下载">
            </div>
        </div>
        <!-- 隐藏域 -->
        <input type="text" id="sourceId" name="sourceId" hidden="hidden" value="-1"/>
    </form>
</div>

</body>
<link rel="stylesheet" lang="less" scoped type="text/css" th:href="@{book/booksource/booksource.css(v=${version})}"/>
<script th:src="@{book/booksource/booksource.js(v=${version})}"></script>
</html>